package com.rybbaby.tss.front.tssMemberPackage.service;


import com.rybbaby.tss.core.web.service.IBaseService;
import com.rybbaby.tss.front.tssMemberPackage.entity.TssMemberPackage;
import com.rybbaby.tss.front.tssMemberPackageHistory.entity.TssMemberPackageHistory;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author 雷春琼
 * @description 会员课时包数据库操作服务接口
 * @createDate 2017-08-10 上午12:04:35
 */
public interface ITssMemberPackageService extends IBaseService<TssMemberPackage> {

    /**
     * 将会员课时包计数字段归0
     * @param memberPackage
     */
    void clearMemberPackagerCountCorrelation(TssMemberPackage memberPackage);

    /**
     * 根据会员id查询购买课时包信息
     *
     * @param memberId
     * @return
     */
    List<Map<String, Object>> getListByMemberId(String memberId, Integer type) throws Exception;

    /**
     * 修改会员课时包状态
     *
     * @param packageStatus
     * @return
     */
    Integer updatePackageStatus(String targetDateId, Integer packageStatus);

    /**
     * 修改会员课时包信息
     *
     * @return
     */
    Integer updateParameterById(Map<String, Object> map, String id)throws Exception;

    /**
     * 扣除课时
     *
     * @param packageInformation
     * @return
     */
    boolean deductiveHours(Map<String, Object> packageInformation);

    /**
     * 扣除课节
     *
     * @param packageInformation
     * @return
     */
    boolean deductiveAttendanceDay(Map<String, Object> packageInformation);

    /**
     * 补课扣除课时
     *
     * @param packageInformation
     * @return
     */
    boolean absenteeismDeductiveHours(Map<String, Object> packageInformation);

    /**
     * 补课扣除课节
     *
     * @param packageInformation
     * @return
     */
    boolean absenteeismDeductiveAttendanceDay(Map<String, Object> packageInformation);

    /**
     * 缺勤可补课
     *
     * @param packageInformation
     * @return
     */
    boolean makeUpClassDeductiveHours(Map<String, Object> packageInformation);

    /**
     * 批量扣除课时
     *
     * @param packageInformation
     * @return
     */
    boolean batchDeductiveHours(List<Map<String, Object>> packageInformation);

    /**
     * 批量扣除课节
     *
     * @param packageInformation
     * @return
     */
    boolean batcheductiveAttendanceDay(List<Map<String, Object>> packageInformation);

    /**
     * 考勤还原补课
     * @param packageInformation
     * @return
     */
    boolean reductionMakeUpClassDeductiveHours(Map<String, Object> packageInformation);

    /**
     * 缺勤还原补课
     * @param packageInformation
     * @return
     */
    boolean reductionAbsenteeismDeductiveHours(Map<String, Object> packageInformation);

    /**
     * 考勤后加补课
     * @param packageInformation
     * @return
     */
    boolean addMakeUpClassDeductiveHours(Map<String, Object> packageInformation);

    Serializable saveMemberPackage(TssMemberPackage saveMemberPackage);

    /**
     * 查询报名状态
     * @param type
     * @param memberId
     * @return
     */
    Map<String,Object> findApplyStatus(Integer type, String memberId);
    /**
     * 获取会员所有信息集合
     * */
    List<TssMemberPackage> getAllList();

    /**
     * 根据会员id查询课时包
     * @param targetDataId
     * @return
     */
    List<TssMemberPackage> findByMemberId(String targetDataId)throws Exception;

    /**
     * 考勤退课  退还课时 亲子
     * @param attendanceMaintenancePackageMap
     * @return
     */
    boolean attendanceMaintenanceForParentingPackage(Map<String, Object> attendanceMaintenancePackageMap);

    /**
     * 考勤退课  退还课时 过渡
     * @param attendanceMaintenancePackageMap
     * @return
     */
    boolean attendanceMaintenanceForTransitionPackage(Map<String, Object> attendanceMaintenancePackageMap);

    /**
     * 更新课时包
     * @param memberPackage
     */
    void updateMemberPackageEntitiy(TssMemberPackage memberPackage);

    /**
     * 根据考勤查询课时包
     * @param ids
     * @return
     */
    List<TssMemberPackage> findHistory(List<String> ids)throws Exception;

    /**
     * 查询  大于 指定时间最早 一条课时包操作记录
     * @param startTime_begin 指定时间
     * @param Type 类型
     * @return
     */
    List<Map<String,Object>> finByHistory(String startTime_begin, String Type);

    /**
     * 增加缺勤天数
     * @param packageInformation
     */
    void absenceRecord(Map<String, Object> packageInformation);
}
